import os

import uiautomation

from config.config import DATA_PATH
from page.index import IndexPage
from page.收费管理.tuikuanchuli__paage import tuikuanchuli
from tools.sjqd_way import read_data_from_excel


class Tiaoshi():
    his = uiautomation.WindowControl(searchDepth=1, Name='科玛奇医院信息管理系统')  # 锁定窗口
    his.SetFocus()
    def tuikuanchuli(self):
        self.data = read_data_from_excel(os.path.join(DATA_PATH, "datas.xls"), "测试患者")
        name = self.data[0][0]
        ap = IndexPage()
        bp = tuikuanchuli()
        ap.click_sfgl_btn()  # 点击收费管理
        ap.click_tkcl_btn()  # 点击退款处理
        bp.input_name(name) #输入患者姓名
        bp.click_cx_btn()  # 点击查询按钮
        bp.click_sfsj1()  # 点击收费数据1
        bp.click_tk_btn()  # 点击退款
        bp.click_tsqd_btn()#点击提示确定按钮
if __name__ == '__main__':
    Tiaoshi().tuikuanchuli()